
<div style="POSITION: relative" id="content">
  <h3>使用easyUI 添加toolbar到datagrid</h3>
  <div id="article_content" class="article_content">
    <p>这个示例向你展示如何添加toolbar到datagrid.</p>
    <p><img src="documentation/images/1344563402_2273.png" alt=""><br>
    </p>
    <p>&nbsp;</p>
<h4 style="font-size:16px; color:rgb(204,0,0); margin:10px 0px; font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif; text-align:left"> 创建 DataGrid</h4>
    <pre name="code" class="html">&lt;table id=&quot;tt&quot; class=&quot;easyui-datagrid&quot; style=&quot;width:600px;height:250px&quot;  
        url=&quot;data/datagrid_data.json&quot;  
        title=&quot;DataGrid with Toolbar&quot; iconCls=&quot;icon-save&quot;  
        toolbar=&quot;#tb&quot;&gt;  
    &lt;thead&gt;  
        &lt;tr&gt;  
            &lt;th field=&quot;itemid&quot; width=&quot;80&quot;&gt;Item ID&lt;/th&gt;  
            &lt;th field=&quot;productid&quot; width=&quot;80&quot;&gt;Product ID&lt;/th&gt;  
            &lt;th field=&quot;listprice&quot; width=&quot;80&quot; align=&quot;right&quot;&gt;List Price&lt;/th&gt;  
            &lt;th field=&quot;unitcost&quot; width=&quot;80&quot; align=&quot;right&quot;&gt;Unit Cost&lt;/th&gt;  
            &lt;th field=&quot;attr1&quot; width=&quot;150&quot;&gt;Attribute&lt;/th&gt;  
            &lt;th field=&quot;status&quot; width=&quot;60&quot; align=&quot;center&quot;&gt;Stauts&lt;/th&gt;  
        &lt;/tr&gt;  
    &lt;/thead&gt;  
&lt;/table&gt;  
&lt;div id=&quot;tb&quot;&gt;  
    &lt;a href=&quot;#&quot; class=&quot;easyui-linkbutton&quot; iconCls=&quot;icon-add&quot; plain=&quot;true&quot; onclick=&quot;javascript:alert('Add')&quot;&gt;Add&lt;/a&gt;  
    &lt;a href=&quot;#&quot; class=&quot;easyui-linkbutton&quot; iconCls=&quot;icon-cut&quot; plain=&quot;true&quot; onclick=&quot;javascript:alert('Cut')&quot;&gt;Cut&lt;/a&gt;  
    &lt;a href=&quot;#&quot; class=&quot;easyui-linkbutton&quot; iconCls=&quot;icon-save&quot; plain=&quot;true&quot; onclick=&quot;javascript:alert('Save')&quot;&gt;Save&lt;/a&gt;  
&lt;/div&gt;  </pre>
    我们不需要写任何的javascript代码,附加toolbar到datagrid通过'<span style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif; font-size:14px; text-align:left">toolbar</span>'属性.
    <p></p>
    <p></p>
    <h4 style="font-size:16px; color:rgb(204,0,0); margin:10px 0px; font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif; text-align:left"> 下载 EasyUI 示例代码:</h4>
    <div style="font-size:14px; font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif; text-align:left; padding-left:50px"> <a href="http://www.jeasyui.com/tutorial/datagrid/downloads/easyui-datagrid4-demo.zip" target="_blank" class="download-link" style="color:rgb(0,0,255)">easyui-datagrid-demo.zip</a></div>
    <br>
    <br>
    <p></p>
  </div>
</div>
<SCRIPT type=text/javascript>
	dp.SyntaxHighlighter.ClipboardSwf = 'documentation/js/clipboard.swf'/*tpa=http://jeasyui.com/SyntaxHighlighter/Scripts/clipboard.swf*/;
	dp.SyntaxHighlighter.HighlightAll('code');
</SCRIPT>